<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>新闻中心-管理员-添加新闻</title>
<link rel="stylesheet" type="text/css" th:href="@{/static/css/header.css}">
<link rel="stylesheet" type="text/css" th:href="@{/static/css/add.css}">
<link rel="stylesheet" type="text/css" th:href="@{/static/css/login-message.css}">
</head>
<body>
	<header>
		<span class="span-head">新闻管理系统</span>
		<div class="header-search">
			<form class="header-form" th:action="@{/admin/Search}">
				<div class="search">
					<div>
						<select name="row" style="height: 30px; width: 60px; border-radius: 8px; border: none; background: none;">
							<option value="all" selected>全部：</option>
							<option value="title">标题：</option>
							<option value="author">作者：</option>
							<option value="content">内容：</option>
						</select>
						<input type="text" class="text-search" name="keyword" maxlength="50" style="font-size: 15px;">
					</div>
					<div>
						<input type="submit" value="搜索" class="butt">
					</div>
				</div>
			</form>
		</div>
		<div class="ulf">
			<ul>
				<li><a th:href="@{/admin/addNew}" class="header-text fresh">刷新</a></li>
				<li><a th:href="@{/admin/main}" class="header-text">所有新闻</a></li>
				<li><a th:href="@{/user/login}" class="header-text">系统登录</a></li>
				<li><a th:href="@{/}" class="header-text">新闻主页</a></li>
			</ul>
		</div>
		<div style="clear:both;"></div>
	</header>
	<div class="big-left">
		<div class="admin-message">
			<div class="hello">欢迎你:</div>
			<span class="adminname" th:text="${session.adminname}"></span>
			<div class="box"></div>
			<div class="login-time"><a th:href="@{/admin/exit}">退出登录</a></div>
		</div>
	</div>
	<div class="center">
        <div class="container">
            <!-- 添加新闻的表单 -->
			<div class="add-news-form">
				<h2>添加新闻</h2>
				<form th:action="@{/admin/CommitNew}" method="post">
					<input type="hidden" name="time" th:value="${nowTime}">
					<!-- 新闻标题 -->
					<label for="newsTitle">新闻标题：</label>
					<input type="text" id="newsTitle" name="Title" required maxlength="50">

					<!-- 新闻类型 -->
					<label for="newsType">新闻类型：</label>
					<select name="Type" id="newsType" required>
						<option value="1">金融</option>
						<option value="2">餐饮</option>
						<option value="3">科技</option>
						<option value="4">生活</option>
						<option value="5">娱乐</option>
						<option value="6">知识</option>
						<option value="7" selected>其他</option>
					</select>

					<!-- 新闻作者 -->
					<label for="newsAuthor">新闻作者：</label>
					<input type="text" id="newsAuthor" name="Author" required maxlength="50">

					<!-- 新闻内容 -->
					<label for="newsContent">新闻内容：</label>
					<textarea id="newsContent" name="Content" rows="10" cols="50" required maxlength="4000"></textarea>

					<div>
						<!-- 提交和取消按钮 -->
						<div class="but-all">
							<input type="submit" class="but first-but"/>
							<a th:href="@{/admin/main}" class="but two-but">返回</a>
							<div class="but time">
								<span style="font-size: 18px;">发布时间</span>
								<span style="color: #AB3F6E; font-size: 18px;" th:text="${nowTime}">时间</span>
							</div>
						</div>
					</div>
				</form>
			</div>
        </div>
    </div>
</body>
</html>
